package com.atguigu.gulimail.order.config;

import com.atguigu.gulimail.order.interceptor.OrderInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author fangy
 * @date 2022-10-16 10:39
 */
@Configuration
public class OrderWebMvcConfig implements WebMvcConfigurer {

    @Autowired
    OrderInterceptor orderInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(orderInterceptor).addPathPatterns("/**");

    }
}
